{include file="header.html"}

<div class="page-header">
	<h6>
		广告管理
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			编辑广告
		</small>
	</h6>
</div><!-- /.page-header -->
<div class="row">
<div class="col-xs-12">
	<form class="form-horizontal" role="form" method="post" action="?app=ad&act=save" enctype="multipart/form-data">
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="name"> 广告标题 </label>
			<div class="col-sm-10">
				<input type="text" id="name" name="name" value="{$row->name}" class="col-xs-6" />
				<input type="hidden" id="id" name="id" value="{$row->id}" class="col-xs-6" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="pic"> 广告图片图片 </label>
			<div class="col-sm-10">
				<input type="file" id="pic" name="pic" value="" class="col-xs-6" />
				<img src="{if $row->pic !== ''}{$row->pic}{else}/images/nopic.png{/if}" style="width:100px;">
				<span style="color: red;">(轮播图:1080x460;海外精选、优选精品:1080x350)</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="ad_content"> 广告内容 </label>
			<div class="col-sm-10">
				<input type="text" id="ad_content" name="ad_content" value="{$row->ad_content}" class="col-xs-6" />
				(可以是id或者链接或者关键词)
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="ad_type"> 广告类型 </label>
			<div class="col-sm-2">
				<select name="ad_type" id="ad_type" class="form-control">
					<option value="">请选择广告类型</option>
					<option value="html5" {if $row->ad_type == 'html5'}selected{/if}>html5 （HTML5网页）</option>
					<option value="recharge" {if $row->ad_type == 'recharge'}selected{/if}>recharge （充值）</option>
					<option value="type" {if $row->ad_type == 'type'}selected{/if}>type （一级分类）</option>
					<option value="subtype" {if $row->ad_type == 'subtype'}selected{/if}>subtype （二级分类）</option>
					<option value="goods" {if $row->ad_type == 'goods'}selected{/if}>goods （商品）</option>
					<option value="article" {if $row->ad_type == 'article'}selected{/if}>article （文章）</option>
				</select> 
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="position"> 广告位置 </label>
			<div class="col-sm-2">
				<select name="position" id="position" class="form-control">
					<option value="flash" {if $row->position == 'flash'}selected{/if}>flash(轮播图)</option>
					<option value="yxjp" {if $row->position == 'yxjp'}selected{/if}>yxjp(优选精品)</option>
				</select> 
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="status"> 状态 </label>
			<div class="col-sm-10">
				<div class="radio">
					<label>
						<input type="radio" name="status" value="1"  class="ace" {if $row->status == 1 }checked{/if}/>
						<span class="lbl"> 显示 </span>
					</label>
				</div>
				<div class="radio">
					<label>
						<input type="radio" name="status" value="2" class="ace"  {if $row->status == 2 }checked{/if}/>
						<span class="lbl"> 隐藏 </span>
					</label>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="service_time"> 优惠开始时间 </label>
			<div class="col-sm-10">
				<input type="text" class="col-xs-4" name="begin_time" id="begin_time" placeholder="开始时间" value="{if $row->begin_time}{$row->begin_time}{/if}" initdate="" /> &nbsp; 到了此日期/时间，优惠将显示出来
			</div>
		</div>

		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="service_time"> 优惠结束时间 </label>
			<div class="col-sm-10">
				<input type="text" class="col-xs-4" name="end_time" id="end_time" placeholder="结束时间" value="{if $row->end_time}{$row->end_time}{/if}" initdate="" /> &nbsp;  到了此日期/时间，优惠将结束
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="sort"> 排序 </label>
			<div class="col-sm-10">
				<input type="text" id="sort" name="sort" value="{$row->sort}" class="col-xs-2" />
			</div>
		</div>

		<div class="clearfix form-actions">
			<div class="col-md-offset-3 col-md-9">
				<button class="btn btn-info" type="submit">
					<i class="ace-icon fa fa-check bigger-110"></i>
					提交
				</button>

				&nbsp; &nbsp; &nbsp;
				<button class="btn" type="reset">
					<i class="ace-icon fa fa-undo bigger-110"></i>
					重置
				</button>
			</div>
		</div>
	</form>
</div>
</div>

{include file="footer.html"}
<script>
$(function(){
	$('#begin_time').datepicker({
		useStyle:'datepicker2',
		readonly:false,
		showTime:true,
		showSecond:false,
		format:'yyyy-mm-dd hh:mm'
	});
	$('#end_time').datepicker({
		useStyle:'datepicker2',
		readonly:false,
		showTime:true,
		showSecond:false,
		format:'yyyy-mm-dd hh:mm'
	});
});
</script>

